package com.zz.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;

/**
 * 权限信息
 * @author zhouzi
 */
@Data
@ApiModel("权限信息")
public class Permission implements Serializable {
    private static final long serialVersionUID = 1L;

    //编号
    @ApiModelProperty("编号")
    @TableId(type= IdType.AUTO)//主键自增
    @NotNull(message = "权限信息表主键不能为空")
    private Integer id;

    //URL
    @ApiModelProperty("URL")
    @NotNull(message = "权限URL不能为空")
    private String path;

    //权限信息
    @ApiModelProperty("权限信息")
    @NotNull(message = "权限信息不能为空")
    private String info;

    @Override
    public boolean equals(Object o){
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Permission that = (Permission) o;
        return info.equals(that.info);
    }

    @Override
    public int hashCode(){
        return Objects.hash(info);

    }


}
